package com.ruoyi.consume.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.consume.mapper.BladeApplyTemporaryConMapper;
import com.ruoyi.consume.domain.BladeApplyTemporaryCon;
import com.ruoyi.consume.service.IBladeApplyTemporaryConService;

/**
 * 刀片临时领用Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-27
 */
@Service
public class BladeApplyTemporaryConServiceImpl implements IBladeApplyTemporaryConService
{
    @Autowired
    private BladeApplyTemporaryConMapper bladeApplyTemporaryConMapper;

    /**
     * 查询刀片临时领用
     *
     * @param bladeApplyTemporaryId 刀片临时领用ID
     * @return 刀片临时领用
     */
    @Override
    public BladeApplyTemporaryCon selectBladeApplyTemporaryById(Long bladeApplyTemporaryId)
    {
        return bladeApplyTemporaryConMapper.selectBladeApplyTemporaryById(bladeApplyTemporaryId);
    }

    /**
     * 查询刀片临时领用列表
     *
     * @param bladeApplyTemporaryCon 刀片临时领用
     * @return 刀片临时领用
     */
    @Override
    public List<BladeApplyTemporaryCon> selectBladeApplyTemporaryList(BladeApplyTemporaryCon bladeApplyTemporaryCon)
    {
        return bladeApplyTemporaryConMapper.selectBladeApplyTemporaryList(bladeApplyTemporaryCon);
    }

    /**
     * 新增刀片临时领用
     *
     * @param bladeApplyTemporaryCon 刀片临时领用
     * @return 结果
     */
    @Override
    public int insertBladeApplyTemporary(BladeApplyTemporaryCon bladeApplyTemporaryCon)
    {
        bladeApplyTemporaryCon.setCreateTime(DateUtils.getNowDate());
        return bladeApplyTemporaryConMapper.insertBladeApplyTemporary(bladeApplyTemporaryCon);
    }

    /**
     * 修改刀片临时领用
     *
     * @param bladeApplyTemporaryCon 刀片临时领用
     * @return 结果
     */
    @Override
    public int updateBladeApplyTemporary(BladeApplyTemporaryCon bladeApplyTemporaryCon)
    {
        bladeApplyTemporaryCon.setUpdateTime(DateUtils.getNowDate());
        return bladeApplyTemporaryConMapper.updateBladeApplyTemporary(bladeApplyTemporaryCon);
    }

    /**
     * 批量删除刀片临时领用
     *
     * @param bladeApplyTemporaryIds 需要删除的刀片临时领用ID
     * @return 结果
     */
    @Override
    public int deleteBladeApplyTemporaryByIds(Long[] bladeApplyTemporaryIds)
    {
        return bladeApplyTemporaryConMapper.deleteBladeApplyTemporaryByIds(bladeApplyTemporaryIds);
    }

    /**
     * 删除刀片临时领用信息
     *
     * @param bladeApplyTemporaryId 刀片临时领用ID
     * @return 结果
     */
    @Override
    public int deleteBladeApplyTemporaryById(Long bladeApplyTemporaryId)
    {
        return bladeApplyTemporaryConMapper.deleteBladeApplyTemporaryById(bladeApplyTemporaryId);
    }

    /**
     * 更新库存量表
     *
     * @param bladeApplyTemporaryCon 刀片临时领用
     * @return 结果
     */
    @Override
    public int updateAmount(BladeApplyTemporaryCon bladeApplyTemporaryCon){
        return bladeApplyTemporaryConMapper.updateAmount(bladeApplyTemporaryCon);
    }

    /**
     * 更新领用状态
     *
     * @param bladeApplyTemporaryId 刀片临时领用ID
     * @return 结果
     */
    @Override
    public int updateConsumeStatus(Long bladeApplyTemporaryId){
        return bladeApplyTemporaryConMapper.updateConsumeStatus(bladeApplyTemporaryId);
    }

    /**
     * 退回操作
     *
     * @param bladeApplyTemporaryId 刀片临时领用ID
     * @return 结果
     */
    @Override
    public int updateApprovalStatus(Long bladeApplyTemporaryId){
        return bladeApplyTemporaryConMapper.updateApprovalStatus(bladeApplyTemporaryId);
    }
}
